package com.lbd.loan.bean;

import com.lbd.base.bean.AbstractEntity;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;
import org.jeecgframework.poi.excel.annotation.Excel;

import javax.persistence.Entity;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * Created by wang on 2016/9/22.
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@Entity
public class Loan extends AbstractEntity {

    //借款人姓名 长度为2-10之间的汉字
    @NotNull
    @Pattern(regexp = "[\\u4E00-\\u9FA5]{2,6}", message = "姓名必须为2-6个汉字。")
    @Excel(name = "借款人姓名")
    private String appName;

    //借款人手机号
    @NotNull
    @Pattern(regexp = "^1\\d{10}$", message = "请输入正确的手机号码。")
    @Excel(name = "手机号")
    private String appMobile;

    //借款金额
    @NotNull
    @Digits(fraction = 0, integer = 4, message = "请输入正确的金额。")
    @Min(1)
    @Excel(name = "借款金额（万元）")
    private String appAmount;

    //借款人常住城市
    @NotNull
    @Pattern(regexp = "[\\u4E00-\\u9FA5]{2,10}", message = "请输入您所在城市名为2-10的长度汉字。")
    @Excel(name = "常住城市")
    private String cityName;

    //借款状态  0-审核中 1-审核通过 2-审核失败
    @Excel(name = "借款状态", replace = {"审核中_0", "审核通过_1", "审核失败_2"})
    private Integer appStatus;

    //借款申请来源 1-PC端 2-微信 3-app端
    private Integer appSource;

    //借款备注
    private String remark;

    //思维力达咨询编号
    private String swldCid;


}
